# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo

class NewsPipeline(object):
    def process_item(self, item, spider):
        client = pymongo.MongoClient('mongodb://10.6.52.147:27017')
        event = client['articles']['news']
        event.insert(dict(item))
        return item
